package projet_ihm;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class Produit {
	protected E_Type type;
	protected int nb;
	protected String name;
	protected int size;
	protected Date date_ajout;
	
	
	
	public Produit(E_Type type, String name, int size, int nb, Date actuelle){
		this.type = type;
		this.name = name;
		this.size = size;
		this.nb = nb;
		this.date_ajout = actuelle;
	}


	public E_Type getType() {
		return type;
	}


	public void setType(E_Type type) {
		this.type = type;
	}


	public String getName() {
		return name;
	}


	public int getNb() {
		return nb;
	}


	public void setNb(int nb) {
		this.nb = nb;
	}


	public int getSize() {
		return size;
	}


	public void setSize(int size) {
		this.size = size;
	}


	public Date getDate_ajout() {
		return date_ajout;
	}


	public void setDate_ajout(Date date_ajout) {
		this.date_ajout = date_ajout;
	}


	public void setName(String name) {
		this.name = name;
	}
	
	public String toString(){
		String txt = "";
		DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
		txt += "Name :" + name + " ,type : " +getType()+ " ,size : "+ size + " ,nb : "+getNb() +", Date ajout : " +dateFormat.format(date_ajout) ; 
		return txt;
	}
}
